#if defined(_MSC_VER)
#pragma once
#endif

#ifndef LM_CORE_TEXTUREMAP_H
#define LM_CORE_TEXTUREMAP_H

#include "lm.h"
#include "intersection.h"
#include "memory.h"

class TextureMap : public ReferenceCounted{
public:
	virtual	void Map(const Intersection &isect, float *s, float *t, float *dsdx, float *dtdx, float *dsdy, float *dtdy) const = 0;
};

class UVMap: public TextureMap {
public:
	UVMap() : su(1.0), sv(1.0), du(0.0), dv(0.0) { }
	UVMap(float _su, float _sv, float _du, float _dv) {
		su = _su;
		sv = _sv;
		du = _du;
		dv = _dv;
	}
	void UVMap::Map(const Intersection &isect, float *s, float *t, float *dsdx, float *dtdx, float *dsdy, float *dtdy) const;
private:
	float su, sv, du, dv;
};



#endif	// LM_CORE_TEXTUREMAP_H